Measure
Easily measure an length on your document or plan.
API
startCreate
Create a measure. You can select between Area, Annotations, Perimeter and Calibration.
| Param | Type | Description |
|---|---|---|
| tool | string | Select the desired tool |
| [single] | bool | Select true to make a single measure, false to make a multi-point measure |
| [color] | string | Change the color of the annotation tool |
| [showLength] | bool | Toogle visibility of the length drawing of the measure - area and perimeter tool |
| [single] | bool | Select true to make a single measure, false to make a multi-point measure |
| [guid] | string | Set a group_guid if you want to add a pin to an existing group |
Available tool options:
- annotation: Select the annotation tool.
- measure: Select measure tool.
- area: Select area tool.
- perimeter: Select perimeter tool.
- calibration: Set a calibration to match the scale of the plan on the pdf.
Example
TFTPDFGadget.callCommand({
name: "startCreate",
args: {
tool: "measure",
showLength: "false",
},
callback: myfunc,
});
info
You can draw a multi-line or a single-line.
- Draw a multi-line
- Draw a single line
TFTPDFGadget.callCommand({
name: "startCreate",
args: {
tool: "measure",
single: "false",
},
callback: myfunc,
});
TFTPDFGadget.callCommand({
name: "startCreate",
args: {
tool: "measure",
single: "true",
},
callback: myfunc,
},
});
setPageAnnotation
Add a JSON annotation on the PDF. The command parse the Json with the className and draw the annotation on the correct page.
| Param | Type | Description |
|---|---|---|
| drawing | Array.JSON | Array of json annotations |
Example
TFTPDFGadget.callCommand({
name: "stopCreate",
callback: myfunc,
});
CAUTION
- Call this command with an
JSON objectto load 1 annotation. - Call this command with an
arrayof xJSON objectto load all of them.
- Load 1 annotation
- Load multiples annotations
TFTPDFGadget.callCommand({
name: "setPageAnnotation",
args: { drawing: { measure_1 } },
callback: myfunc,
});
TFTPDFGadget.callCommand({
name: "setPageAnnotation",
args: { drawing: [{ measure_1 }, { measure_2 }, { measure_3 }] },
callback: myfunc,
});
stopCreate
Stop the current tool.
Example
TFTPDFGadget.callCommand({
name: "stopCreate",
callback: myfunc,
});
deleteAnnotation
Delete annotation with his GUID.
| Param | Type | Description |
|---|---|---|
| guid | string | GUID of the annotations group. |
Example
TFTPDFGadget.callCommand({
name: "deleteAnnotation",
args: {
guid: "4a4f720b64b7-4170-aa1b-80c8fdb595d3",
unique_guid: "xxxxxxxxx-xxxxx-xxxxx",
},
callback: myfunc,
});
setSelection
Select a perimeter
| Param | Type | Description |
|---|---|---|
| guid | string | GUID of the annotations group. |
Example
TFTPDFGadget.callCommand({
name: "setSelection",
args: { guid: "4a4f720b-64b7-4170-aa1b-80c8fdb595d3" },
callback: myfunc,
});
resetSelection
Reset the current selection
| Param | Type | Description |
|---|---|---|
| guid | string | GUID of the annotations group. |
Example
TFTPDFGadget.callCommand({
name: "resetSelection",
args: { guid: "4a4f720b-64b7-4170-aa1b-80c8fdb595d3" },
callback: myfunc,
});
moveAnnotation
Move the desired annotation - Start the state to edit position, stop with stopMoveAnnotation.
Example
TFTPDFGadget.callCommand({ name: "moveAnnotation", callback: myfunc });
stopMoveAnnotation
Disable the moveAnnotation mode.
Example
TFTPDFGadget.callCommand({
name: "stopMoveAnnotation",
callback: myfunc,
});